package com.zut.oss.adapter;

import com.zut.oss.entity.FileInfo;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;
import java.util.List;

public interface StorageAdapter {

    /**
     * 创建bucket桶
     */

    void createBucket(String bucket) throws Exception;

    /**
     * 上传文件
     * @param bucket
     * @param ObjectName
     * @throws Exception
     */
    void uploadBucket(MultipartFile multipartFile, String bucket, String ObjectName);


    /**
     * 列出所有桶名字
     * @throws Exception
     */
     List<String> getAllBucket();


    /**
     * 列出该桶下的所有文件名字
     * @throws Exception
     */
     List<FileInfo> getBucketAllFileName(String bucket);

    /**
     * 下载文件
     */
     InputStream downLoad(String bucket,String objectName);
    /**
     * 删除桶
     */
     void deleteBucket(String bucket);

    /**
     * 删除文件
     */
     void deleteBucketFile(String bucket,String objectName);

    String getUrl(String bucket, String objectName);
}
